All Questions
21 questions
0votes
3answers
1kviews
How to solve a circular dependency with a composition relation?
For a game I'm making I have two objects; Gun and ReloadSystem. At the moment, these two object reference each other. Gun tells ReloadSystem to perform a reload when the gun gets clicked, and ...
7votes
1answer
3kviews
Modelling java annotations in an UML class diagram
Goal: I am trying to create a UML class diagram for a java spring application. Spring uses a lot of annotations and I couldn't find any resources online on how to properly model them in UML. I know ...
1vote
3answers
757views
Design with subclasses being aggregates of classes implementing interfaces
I have modelled a class structure, where subclasses Rectangle and Circle inherit from an abstract superclass Figure. All subclasses share an interface IGeometry that provides for getArea() and ...
-3votes
1answer
1kviews
How to know if the UML class diagram design is good (well-planned) or not in java
I've learned the UML recently and I am trying to build a MonsterDuel system. However, there are a lot of classes in this project, and I am confused about the abstract class and its usage. Now, I have ...
1vote
5answers
8kviews
When should i use an abstract class vs an interface? [duplicate]
I'm fairly new to programming. At school I am currently learning to program with Java. I want to build an application where i can store my collection of books, records, boardgames and such. Started ...
-2votes
1answer
8kviews
UML Class Diagram HashMap Data Type
How can I show a Java HashMap data type in UML Class Diagram (or C# dictionary)? I.E. This class: public class Test { private Map<String, String> map; private Map<String, int> ...
2votes
1answer
2kviews
Should we write diagram uml for our code before start programming? [duplicate]
Today in UML class our teacher told us that it is very important to create uml diagram of our java code and use design pattern before starting to program any application. I find that weird because ...
-1votes
1answer
407views
Problem with OOP design
I have a problem with design a few simple classes. I want a four classes: one recursively delete directory, another copy one dir to another same way. Another two does same as first two but they add ...
3votes
2answers
2kviews
Modeling Composite Design Pattern
I'm using Java Eclipse EMF to model my Composite Pattern. What would be the right UML representation to model aa new class (Root) which implements a unique root directory. This is the original ...
4votes
1answer
5kviews
Which is better of these two class diagrams for calculator project and why?
I'm a novice programmer i draw two class diagrams for calculator Project, i want you to check each one of them and tell me which one is better and also, i would appreciate it if you point out the ...
1vote
1answer
3kviews
UML: do I use aggregation or composition in this case?
I would like to draw a UML sketch to communicate part of a software but the type of relationship between classes does not seem very clear cut to me. Let's say I want to periodically fetch the recent ...
0votes
1answer
569views
UML- Aggregation or Association
Below is the problem for which I have created a UML diagram with Staff as superclass and waiter, manager and hosts as subclasses, I understood other parts, except for the relation between table and ...
0votes
1answer
4kviews
How do you write super() in the UML format?Is it correct to write super(parameter: type): return type in the UML methods section?
Suppose you write a subclass that extends to a certain class and in that subclass, you use the super() method for your constructor. Would you write "super(parameter: type): return type" in the UML?
5votes
1answer
1kviews
Client-side classes structure in UML project
I and two university colleagues of mine are designing a simple CMS software for a university exam using UML. Such software just needs to deal with sending an article, assigning an article for review, ...
2votes
3answers
6kviews
How do I show 'creates' in a UML class diagram?
Let's say my code is going to look like this: public class MyController { private Foo foo; private FooGenerator fooGen; //setters public void work() { this.foo = this....